<?php

/**
 * PagosVenta form base class.
 *
 * @package    tercermilenio
 * @subpackage form
 * @author     Your name here
 */
class BasePagosVentaForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'pag_id'      => new sfWidgetFormInputHidden(),
      'pag_venta'   => new sfWidgetFormPropelChoice(array('model' => 'Ventas', 'add_empty' => false)),
      'pag_fecha'   => new sfWidgetFormDateTime(),
      'pag_monto'   => new sfWidgetFormInput(),
      'pag_tipo'    => new sfWidgetFormPropelChoice(array('model' => 'Pagos', 'add_empty' => false)),
      'pag_plazo'   => new sfWidgetFormDate(),
      'pag_saldo'   => new sfWidgetFormInput(),
      'pag_usuario' => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'pag_id'      => new sfValidatorPropelChoice(array('model' => 'PagosVenta', 'column' => 'pag_id', 'required' => false)),
      'pag_venta'   => new sfValidatorPropelChoice(array('model' => 'Ventas', 'column' => 'vta_id')),
      'pag_fecha'   => new sfValidatorDateTime(),
      'pag_monto'   => new sfValidatorNumber(),
      'pag_tipo'    => new sfValidatorPropelChoice(array('model' => 'Pagos', 'column' => 'pag_id')),
      'pag_plazo'   => new sfValidatorDate(),
      'pag_saldo'   => new sfValidatorNumber(),
      'pag_usuario' => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('pagos_venta[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PagosVenta';
  }


}
